package com.icinfo.cloud.provider.punish.config.service;


import com.icinfo.cloud.provider.common.service.PunishBaseService;
import com.icinfo.cloud.provider.punish.config.dto.ConfigOrgRegulatoryDiscretionRuleDto;
import com.icinfo.cloud.provider.punish.config.enums.DiscretionApplyCaseTypeEnum;
import com.icinfo.cloud.provider.punish.config.enums.DiscretionRuleApplyTypeEnum;
import com.icinfo.cloud.provider.punish.config.enums.DiscretionRuleConfigTypeEnum;
import com.icinfo.cloud.provider.punish.config.model.ConfigOrgRegulatoryDiscretion;
import com.icinfo.cloud.provider.punish.config.model.ConfigOrgRegulatoryDiscretionRule;
import com.icinfo.cloud.provider.punish.config.vo.ConfigOrgRegulatoryDiscretionRuleCountVo;
import com.icinfo.cloud.provider.punish.config.vo.ConfigOrgRegulatoryDiscretionRuleVo;

import java.util.List;

/**
 * @author HKxxx
 * @date 2024/1/31 15:21
 */
public interface IConfigOrgRegulatoryDiscretionRuleService extends PunishBaseService {
    List<ConfigOrgRegulatoryDiscretionRuleCountVo> getCurrentOrgRuleCountByCatalogIds(List<String> catalogIds);

    /**
     * 获取挡圈部门规则通过事项id集合
     *
     * @param catalogIds 事项id集合
     * @return 事项id对应的规则集合
     */
    List<ConfigOrgRegulatoryDiscretionRule> getCurrentOrgRuleByCatalogIds(List<String> catalogIds);


    /**
     * 处理自由裁量规则信息
     *
     * @param discretion    自由裁量主表id
     * @param personalRules 个人规则
     * @param orgRules      单位规则
     * @param configType    启用标准
     */
    void handleDiscretionRuleInfo(ConfigOrgRegulatoryDiscretion discretion,
                                  List<ConfigOrgRegulatoryDiscretionRuleDto> personalRules,
                                  List<ConfigOrgRegulatoryDiscretionRuleDto> orgRules,
                                  DiscretionRuleConfigTypeEnum configType);

    /**
     * 根据规则适用范围和事项catalogId获取违法情形列表
     *
     * @param orgCode   查询的部门code
     * @param applyType 适用范围类型
     * @param catalogId 事项catalogId
     * @return
     */
    List<ConfigOrgRegulatoryDiscretionRuleVo> getByOrgAndApplyTypeAndCatalogId(String orgCode, DiscretionRuleApplyTypeEnum applyType, DiscretionApplyCaseTypeEnum applyCaseType, String catalogId);

    /**
     * 根据部门code，事项catalogId，applyType集合查询规则，并在违法情形前拼接适用范围
     *
     * @param orgCode    组织code
     * @param catalogId  事项catalogId
     * @param applyTypes 适用范围集合
     * @return 违法情形列表
     */
    List<ConfigOrgRegulatoryDiscretionRuleVo> getByOrgAndCatalogIdAndApplyTypes(String orgCode, String catalogId, List<DiscretionRuleApplyTypeEnum> applyTypes, DiscretionApplyCaseTypeEnum applyCaseType);

}
